package com.ln.cmsln.service.impl.bai;

import com.ln.cmsln.mapper.bai.UserMapper;
import com.ln.cmsln.pojo.entity.bai.Permission;
import com.ln.cmsln.pojo.entity.bai.Role;
import com.ln.cmsln.pojo.entity.bai.User;
import com.ln.cmsln.service.bai.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author baiyuxiang
 * @description 用户实现类
 * @date 2022/3/31 20:13
 * @Version 1.0
 **/
@Service
public class UserServiceImpl implements UserService {

    @Resource
    private UserMapper userMapper;

    @Override
    public User getUsess(User user) {
        return userMapper.getUsess(user);
    }

    @Override
    public List<Permission> findurp(String id) {
        return userMapper.findurp(id);
    }

    @Override
    public List<User> findAllinfo() {

        return userMapper.findAllinfo();
    }

    @Override
    public void delUser(User user) {
        userMapper.delUser(user);

    }

    @Override
    public void delss(List<String> list) {
        userMapper.delss(list);

    }

    @Override
    public void addUser(User user) {
        userMapper.addUser(user);

    }

    @Override
    public User toUpdate(User user) {

        return userMapper.toUpdate(user);
    }

    @Override
    public void updateInfo(User user) {
        userMapper.updateInfo(user);

    }

	/*@Override
	public List<Role> asignUserOne(User user) {

		return userMapper.asignUserOne(user);
	}*/

    @Override
    public List<Role> asignUserTwo(User user) {

        return userMapper.asignUserTwo(user);
    }

    @Override
    public List<String> queryrolesing(User user) {

        return userMapper.queryrolesing(user);
    }

    @Override
    public void unrole(String userid, List<String> list) {
        userMapper.unrole(userid,list);

    }

    @Override
    public void dorole(String userid, List<String> list) {
        userMapper.dorole(userid,list);

    }

    @Override
    public Permission getper() {

        return userMapper.getper();
    }

    @Override
    public List<Permission> findbyidchild(Permission permission) {

        return userMapper.findbyidchild(permission);
    }

    @Override
    public List<Permission> finAllPre() {
        return userMapper.finAllPre();


    }
}
